﻿@using EquipmentManager.Entities
@model EquipmentManager.Models.ListModel<PostOffice, Region>

@{
    ViewBag.Title = "Список отделений в " + Model.Parent.Name + " в дирекции " + Model.Parent.Directorate.Name;
}

@section menu {
    <section class="featured">
            <div class="master-menu">
                @{Html.RenderPartial("OperatorMenu");}
            </div>
    </section>
}

<h2>Список отделений @Model.Parent.Name в дирекции @Model.Parent.Directorate.Name</h2>

<table class="bordered">
    <thead>
        <tr>
            <th>Оборудование</th>
            <th>Добавить</th>
            <th>Название</th>
            <th>Оборудований</th>
        </tr>
    </thead>
    @foreach (var postOffice in Model.ListItems)
    {
        <tr>
            <td class="Center column-detail">@Html.ActionLink("Оборудование", "Equipments", "Operator", new { PostOfficeId = postOffice.Id }, new { @class = "common-btn BlueColor" })</td>
            <td class="Center column-detail">@Html.ActionLink("+ Обору-ние", "CreateEquipment", "Operator", new { PostOfficeId = postOffice.Id }, new { @class = "common-btn BlueColor" })</td>
            <td>@postOffice.Name</td>
            <td class="Center">@postOffice.Equipments.Where(e => e.Status == EntityStatus.Active).Count()</td>
        </tr>
    }
</table>
